package com.dis.consumer;

import com.dis.entity.BaseData;
import com.lmax.disruptor.WorkHandler;
import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.atomic.AtomicInteger;

@Slf4j
public class TranforWarningDataConsumer implements WorkHandler<BaseData> {

    private String consumerId;

    private static AtomicInteger count = new AtomicInteger(0);

    public TranforWarningDataConsumer(String consumerId){
        this.consumerId = consumerId;
    }

    public void onEvent(BaseData event) throws Exception {
        //将实时数据转换成预警数据形式并存储
        log.info("TranforWarningDataConsumer {} ,拿到消息{}",consumerId,event);
        count.incrementAndGet();
    }
}
